<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Update7 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('asset_records', function (Blueprint $table) {

            $table->integer('sub_type')->default(1)->comment('1为系统修改、2为管理后台手动修改、3批量导入修改');

            $table->integer('user_id')->unsigned()->index()->comment('用户id'); 
            $table->integer('admin_id')->unsigned()->nullable()->index()->comment('操作人id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('asset_records', function (Blueprint $table) {
            $table->dropColumn('sub_type');
            $table->dropColumn('user_id');
            $table->dropColumn('admin_id');
        });
    }
}
